package org.redmaple.core.template.model;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;

/**
 * 所有Model的基类
 * 
 * @author Xiangyun
 *
 */
@MappedSuperclass
@SuppressWarnings("serial")
public abstract class BaseModel implements Serializable {
	
	/**
	 * ID
	 */
	private String id;
	
	/**
	 * 创建时间
	 */
	private Timestamp createTime;
	
	/**
	 * 最后修改时间
	 */
	private Timestamp lastChangeTime;

	@Id
	@GeneratedValue(generator = "primaryKey")
	@GenericGenerator(name = "primaryKey", strategy = "assigned")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
	public Timestamp getLastChangeTime() {
		return lastChangeTime;
	}
	public void setLastChangeTime(Timestamp lastChangeTime) {
		this.lastChangeTime = lastChangeTime;
	}
	
}
